package com.zhijian.medical.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import com.zhijian.response.annotation.Response;
import com.zhijian.util.page.Page;

import com.zhijian.medical.entity.po.CnasNewLocation;
import com.zhijian.medical.service.CnasNewLocationService;
import com.zhijian.medical.entity.vo.request.CnasNewLocationSearchVo;
import com.zhijian.medical.entity.vo.request.CnasNewLocationSaveOrUpdateVo;
import com.zhijian.medical.entity.vo.response.CnasNewLocationVo;

import lombok.extern.slf4j.Slf4j;
import java.util.List;

/**
 * cnas层级表 控制层
 * 
 * @author auto
 * @version 1.0
 * @date 2025-06-19 09:32:05
 */
@Slf4j
@Controller
@Api(tags = "cnas层级表")
public class CnasNewLocationController {

	@Autowired
    private CnasNewLocationService service;

    /**
     * 删除
     *
     * @param id
     * @return
     */
    @Response
    @DeleteMapping("/cnas/new/location/{id}")
//    @ApiOperation("删除")
    public boolean delete(@PathVariable("id") Long id) {
        log.info("{} - {}| delete info", this.getClass().getSimpleName(), id);
        service.deleteById(id);
        return true;
    }


    @Response
    @GetMapping("/cnas/new/location/tree/{parentType}")
    @ApiOperation("子菜单树")
    public List<CnasNewLocationVo> selectListTree(@PathVariable("parentType") Integer parentType) {
        return service.buildTreeByParentType(parentType);
    }

}